Repository navigation
Add status_code and final_url to fetch results - #159
Merged
Merged
Conversation
The API now returns the HTTP status of the fetched page and the URL it ended on after redirects, for fetch, batch fetch and web crawl. Expose both as optional fields on FetchResponseData and PageData so callers can tell an error or block page from real content. Bump version to 1.15.6. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
AHarmlessPyro
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The API is adding two fields to fetch results: the HTTP status of the page that was read and the URL it ended on after redirects. This exposes them on the SDK models so callers can tell an error or block page from real content.
Changes
FetchResponseData(single fetch) andPageData(batch fetch and web crawl pages) gain optionalstatus_code(aliasstatusCode) andfinal_url(aliasfinalUrl).tests/test_web_fetch_status.pycovering fetch, batch fetch and web crawl responses, with and without the fields.Both fields default to
None: the API omits them when the browser received no response. Released versions of the SDK already ignore the extra fields, so nothing breaks for callers who have not upgraded.Validation
ruff check .passes.ruff format --checkpasses on the changed files.pytest tests --ignore=tests/sandbox/e2e: 1078 passed, 4 skipped (Python 3.12).Should be released once the API change that returns these fields is live.
🤖 Generated with Claude Code
Note
Low Risk
Additive optional Pydantic fields on response models only; backward compatible with omitted or extra API keys.
Overview
Extends the Python SDK so fetch, batch fetch, and web crawl results can carry the HTTP status and post-redirect URL the API now returns.
Optional
status_code(statusCode) andfinal_url(finalUrl) were added toFetchResponseData(single fetch) andPageData(per-page batch/crawl output). Both default toNonewhen the API omits them (no browser response or older cached payloads). Serialization uses the existing alias pattern.Adds
tests/test_web_fetch_status.pyfor parsing, aliased dumps, and omitted fields. Version bumped to 1.15.6.Reviewed by Cursor Bugbot for commit 62e934b. Bugbot is set up for automated code reviews on this repo. Configure here.